package train48days;

import java.util.*;
public class 数组中出现次数超过一半的数字 {
        public int MoreThanHalfNum_Solution(int [] array) {

        int i = array.length/2;
        Arrays.sort(array);
        return array[i];
        }

    public static void main(String[] args) {
        HashMap<Integer,Integer> hashMap = new HashMap<>();
        hashMap.put(1, hashMap.getOrDefault(1,0)+1);
        System.out.println(hashMap.get(1));
    }
}
